redkitfandomcom-20200214-history
Creating New Items
!!!!!! WORK IN PROGRESS !!!!! Introduction Difficulty: Advanced This tutorial will show you how to create new usable and working items of any type, without replacing the existing ones. It does NOT describe how to create and use new models and icons (that's something for a seperate tutorial) - we will be using the resources that are already in the game, just with a different name/statistics. Credits * Unelith (me) Getting Started Like I usually do with most of my tutorials - I'm warning you - you must think whether you really need these all-new items. Adding new ones is moderately-hard to do, but it's harder to include those changes in the final, cooked version of your mod. It will require editing *.xml files, and later playing around with Gibbed RED Tools - unpacking, packing and manually editing string files. Of course most stuff in REDKit is rather complicated, so... whatever. In this tutorial I will disregard the world almost completely. Of course you need a world to test your stuff and pack your mod in the end (as far as I know), so just get a working one. I assume that you know how to do that. If not, go check the Tutorial Table of Contents and take a look at some basic tutorials. I also assume that you know how to use command line applications, such as Gibbed RED Tools, and know how to work with *.xml files. Of course SAVE OFTEN, etc. I will create a new sword as an example. #1 - The "def_item_*.xml" file The *.xml files are not to be found in the Asset Browser. You have to locate them physically on your hard drive. Go to (your Witcher 2 directory)\data\items. There are lots of *.xml files there. In this example, we are making a sword. A steel sword, more precisely. So open the def_item_steelsword.xml file in a text editor (I recommend Notepad++, but a built-in Windows Notepad will do). Everything between ' and ' is a single item definition. On the top of this file you will see some definitions for belts and scabbards, but we don't want that. Go search for a sword. Most swords are defined by their English name, so just search for "Temerian Steel Sword" - for example. Then copy that entire item definition, and use the Save As option. Save it in the same directory, just under a different name - keep in mind that it must start with "def_" and it should be all lowercase and no spaces or special signs. Obviously save it with an *.xml extension. The reason to do all that is to have a seperate file for all your custom items. I called mine "def_unelith_items.xml". The next step is to delete all definitions in your file, so that only this remains: Inside the ' tag, all your item definitions will go. The ability definitions (you will see later what exactly "ability" means in terms of items) go inside the ' tag. Now copy the item definition that you have copied before, and paste it in the ' tag. SteelSword,SortTypeWeapon,sword_normal,Weapon,Dismantle,crt_bleed,crt_poison,crt_burn scabbard_steel Temerian Steel Sword _Stats Weight_8 Wood lumber Iron ore Thankfully, we won't need to care about most of that stuff. I will only describe the useful values. ' scabbard_steel '// I think this entire (...) tag can be deleted TESTING if you don't want a scabbard to appear. If you have added different scabbards previously, then you can put your scabbard's name inside, in an (...) tag. Not sure if it works with other items, like hair, or if you can add multiple items this way, but in theory it should be possible. ' Temerian Steel Sword _Stats Weight_8 '// And here is the most interesting part - the statistics of our item. I'll begin at the end - you can set your item's weight by adding Weight_# in the (...) tag. Replace #''' with your desired weight, just remember, that weights are predefined as abilities and the only allowed values are: '''01, 02, 05 (for an effective weight of 0.1, 0.2 and 0.5 respectively), and all the integers starting at 1''' and finishing with '''25. For instance: Weight_0.5 is incorrect, type Weight_05 instead. Weight_03 is incorrect - there is no such weight. Weight_30 is incorrect aswell - 30 is bigger than 25. Weight_12.5 is incorrect too - it must be an integer. If you want the reason behind this - go check the "def_weights.xml" file, and you will understand. Yes, you can add new weights, but that's not the point of this tutorial. Now let's take a look at the Temerian Steel Sword _Stats ability. Go and check the "def_stats_item_swordsteel.xml". You can find this ability amongst many different ones for different steel swords. As you see, all of them have damage_min and damage_max values, and some also have different stats, such as a chance to make someone bleed. You can play with these abilities - you can create a new one by copying an existing one (the entire (...) tag) into your *.xml file, just like you have copied the entire item entry. Then mix some crit effects, change the damage, etc. I, for one, set my sword's damage to 10-20, and I gave it a 100% chance for critical effects: freeze and bleed, because why the hell not. The name of my ability is completely unrelated to the weapon's name, just to show, that it doesn't need to be - just call it whatever you want, then go back to your item definition and replace the "Temerian Steel Swords _Stats" in (...) tag with the name of either your new, custom ability, or one of the already existing ones. Here is my entire *.xml as for right now (I also set the enhancement_slots to 3 and the weight to 0.2 in the item definition): SteelSword,SortTypeWeapon,sword_normal,Weapon,Dismantle,crt_bleed,crt_poison,crt_burn scabbard_steel Retarded Crit Weapon _Stats Weight_02 Wood lumber Iron ore '!!!!!! WORK IN PROGRESS !!!!! __FORCETOC__